{{include file="default/Public/header.html"}}
<script src="{{$smarty.const._PUBLIC_}}js/editable/jquery.editable.js" type="text/javascript"></script>
<script language="javascript">
$().ready(function (){	
	$(".editable_sort").editable('{{U url="fjob/edit?ajax=sort&catid=`$catid`"}}',{
			indicator : '<img src="__ROOT__/admin/Public/images/loading2.gif" />',
      tooltip   : "点击可编辑排序",
			name			: 'sort',
			id				: 'id',
			placeholder : '不可用',
			select	  : true,
			event	  : "click",
			onblur : "submit"
	});
});

function del()  //选择删除
{
	if($(':checkbox:checked[name="info[id][]"]').length > 0)
	$('#jobForm').submit();
}
</script>
<form name="search" class="filter" method="POST" action="{{U url='fjob/manage'}}" target="_self">
<div id="pageTop">
	<div class="addBtn">
		<a href='{{U url="fjob/add?catid=`$catid`"}}'>添加新职位</a>
	</div>
	<div class="delBtn">
		<a href="javascript:void(0);" onclick="del(); return false;">删除</a>
	</div>
	<div class="batch">
		<select name="status" onchange="$('.filter').submit();">
		  	<option value="all">状态过滤</option>
	      	{{html_options options=$status selected=$in.status}}
	      </select>
	</div>
	<div class="search">
		<select name='field'>
		  	{{html_options options=$q_fields selected=$in.field}}
          </select>
          <input type="text" name="q" onblur="if (value ==''){value='请输入关键字'}" onfocus="if (value =='请输入关键字'){value =''}" value="请输入关键字"/>
          <input type="hidden" name="catid" value="{{$catid}}" />
          <button type="submit"></button>
	</div>
</div>
</form>

<form id="jobForm" method="post" action="__APP__">
<div id="pageCo">
	<div class="listForm">
		<table cellpadding="0" cellspacing="0">
			<thead>
				<tr>
					<th width="40"><input type="checkbox" name="checkAll" /></th>
				    <th width="40">ID</th>
				    <th>职位名称</th>
				    <th width="40">排序</th>
				    <th width="60">所属部门</th>
				    <th width="80">有效期</th>
				    <th width="80">创建时间</th>
				    <th width="55">查看简历</th>
				    <th width="40">审核</th>
				    <th width="70">操作</th>
				</tr>
			</thead>
			<tbody> 
				{{foreach from=$data.info item=v}}
				  <tr>
				    <td width="40"><input type="checkbox" name="info[id][]" rel="checkbox" value="{{$v.id}}" /></td>
				    <td width="40">{{$v.id}}</td>
				    <td><a href="{{$category.url}}show?job_id={{$v.id}}" target="_blank">{{$v.title}}</a></td>
				    <td width="40" class='editable_sort pointer' id='sort_{{$v.id}}'>{{$v.sort}}</td>
				    <td width="60">{{$v.department}}</td>
				    <td width="80">{{$v.end_time|date_format:"%Y-%m-%d"}}</td>  
				    <td width="80">{{$v.create_time|date_format:"%Y-%m-%d"}}</td>
				    <td width="55"><a href='{{U url="fjob/resume_manage?job_id=`$v.id`&catid=`$catid`"}}'>查看</a></td>
				    <td width="40">
				    	{{if $v.status == '1'}}
					    <a href='{{U url="fjob/check?_tablename=job&id=`$v.id`&status=0&catid=`$catid`"}}' class="green">已审</a>
					    {{else}}
					    <a href='{{U url="fjob/check?_tablename=job&id=`$v.id`&status=1&catid=`$catid`"}}' class="red">待审</a>
					    {{/if}}</td>
				    <td width="70">
				    <a href='{{U url="fjob/edit?_tablename=job&id=`$v.id`&catid=`$catid`"}}'>修改</a> | 
				    <a href='{{U url="fjob/delete?_tablename=job&id=`$v.id`&catid=`$catid`"}}' onclick="return window.confirm('此操作不可恢复，你确定要删除该模块在系统的注册信息？');">删除</a></td>
				  </tr>
				  {{foreachelse}}
				  <tr>
				  	<td colspan="11" align="center"> 暂时没有数据！</td>
				  </tr>
				  {{/foreach}}
			</tbody>
		</table>	
	</div>	
	<div class="pageList">
		{{$data.pages}}
		<ul class="clearit"></ul> 
	</div>
</div>
<input type="hidden" name="m" value="fjob" />
<input type="hidden" name="a" value="delete" />
<input type="hidden" name="catid" value="{{$catid}}" />
</form>
{{include file="default/Public/footer.html"}}